'''
Created on Jun 20, 2012

@author: thomas_dao
'''
from google.appengine.ext import ndb
from webapp2_extras.appengine.auth.models import User
import logging

class Bill(ndb.Model):
    # Message is similar to email body
    message = ndb.StringProperty()
    # Title is similar to email subject
    title = ndb.StringProperty()
    total_amount = ndb.FloatProperty()
    remind_freq = ndb.StringProperty()
    owner = ndb.KeyProperty(kind=User)
    created_time = ndb.DateTimeProperty(auto_now_add=True)


class Friend(ndb.Model):
    email = ndb.StringProperty()
    name = ndb.StringProperty()
    friend_of = ndb.KeyProperty(kind=User)
    created_time = ndb.DateTimeProperty(auto_now_add=True)

    
class FriendBill(ndb.Model):
    owner = ndb.KeyProperty(kind=User)
    amount = ndb.FloatProperty()
    paid = ndb.BooleanProperty(default=False)
    friend = ndb.KeyProperty(kind="Friend")
    bill = ndb.KeyProperty(kind="Bill")
    reply = ndb.StringProperty()
    created_time = ndb.DateTimeProperty(auto_now_add=True)